<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        html,
        body {
            height: 100%;
        }

        canvas {
            width: 100vw;
            height: 100vw;
        }
    </style>
</head>

<body>

</body>
<script src="./js/bundle.umd.js"></script>
<script>
    var view = new MK.MkView();
    view.setWidth(200);
    view.setHeight(200);
    var lastChild;
    for (var i = 1; i <= 10; i++) {
        var rect = new MK.RectView('tag' + i);
        rect.openPercentageMode();
        rect.setWidth(90);
        rect.setHeight(90);
        rect.setBgColor('#' + Math.floor((Math.random() * 10000000)).toString(16));
        rect.setHorizontalCenter(true);
        rect.setVerticalCenter(true);
        if (lastChild) {
            rect.addView(lastChild);
        }
        lastChild = rect;
    }
    view.addView(lastChild);
    view.setHorizontalCenter(true);
    view.setVerticalCenter(true);
    view.render();
    console.log(view)
    document.body.appendChild(view.getCanvas());

</script>

</html>